﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$UserLoginDBConnection$" formatter="bizobjlist of Company">
  <Sql>
	  SELECT  t.objectId as id,t.parentId,t.parentHostId,c.name,tc.keyName,tc.depth,
		c.anonymousId,c.canCreateChildCompanies,c.enable,c.autoCreateCompany, c.shortName,
		c.autoCreateUser
	  FROM ObjectTreeNodes  t 
	  	LEFT OUTER JOIN ObjectTreeCounts as tc on tc.objectId = t.objectId
		INNER JOIN Companies c ON c.id=t.objectId
	  WHERE t.parentHostId=@parentId
	  ORDER BY tc.keyName
  </Sql>
  <Param name="parentId" type="UniqueIdentifier"/>
</AdoNetDataAccess>